package com.shengtsource.minicat.model;

import java.io.IOException;

public abstract class HttpServlet implements Servlet {
    @Override
    public void service(Request request, Response response) throws Exception {
        String method = request.getMethod();
        if("GET".equalsIgnoreCase(method)) {
            doGet(request,response);
        }else {
            doPost(request,response);
        }
    }

    public abstract void doGet(Request request,Response response) throws IOException;
    public abstract void doPost(Request request,Response response) throws IOException;
}
